﻿[output_none]

	[if: (action_param:'meta_description')!='' || (action_param:'meta_keywords')!='']
	
		[var:'meta_description'=(encode_sql:(action_param:'meta_description'))]
		[var:'meta_keywords'=(encode_sql:(action_param:'meta_keywords'))]
		
		[var:'pageform_lang'=(encode_sql:(action_param:'pageform_lang'))]
		[if:(action_param:'pageform_page')==''][var:'pageform_page'=1][else][var:'pageform_page'=(encode_sql:(action_param:'pageform_page'))][/if]

		[var:'sql_save_meta'='
			UPDATE		SHb_translations_pages
			SET			meta_description	= \'' + $meta_description + '\'
						, meta_keywords	= \'' + $meta_keywords + '\'
			WHERE		_k2_pageid		= \'' + $pageform_page + '\'
			AND			_k2_languageid	= \'' + $pageform_lang + '\'
		']
			
		[Inline: -database='SHoebox', -sql=$sql_save_meta]
		
			[if:(error_currenterror:-errorcode)==0]
				[var:'output_message'='Meta tags Saved']
			[else]
				[var:'output_message'='An error occured while saving']
			[/if]
			
		[/inline]
	
	[else]
	
		[var:'output_message'='An error occured while saving']
		
	[/if]
	
[/output_none]
<b>[var:'output_message',-encodenone]</b>